package com.yingxin.yxerp.module.inform.vo.resp;

import com.yingxin.yx.framework.commons.vo.CommonRespVo;
import com.yingxin.yxerp.module.inform.entity.enums.UserNoticeReadFlag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

/**
 * 通知公告-公告
 * @author zhuchangjie
 * @since 2021-12-21
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="NoticeRespVo对象", description="通知公告-公告")
public class NoticeRespVo extends CommonRespVo {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "标题 ")
    private String title;

    @ApiModelProperty(value = "公告类型id ")
    private String noticeTypeId;

    @ApiModelProperty(value = "有效期天数")
    private Integer expireDays;

    @ApiModelProperty(value = "有效期")
    private String expire;

    @ApiModelProperty(value = "公告内容")
    private String content;

    @ApiModelProperty(value = "用户是否已读 状态")
    private String readFlag;

    @ApiModelProperty(value = "用户是否已读 状态名称")
    private String readFlagName;

    public String getReadFlagName(){
        if( StringUtils.isNotEmpty( readFlag ) ){
            return UserNoticeReadFlag.getEnum( readFlag ).getFlagName();
        }
        return null;
    }

    @ApiModelProperty(value = "公告类型 ")
    private String noticeType;

}
